
from django.http import HttpResponse

import json

def render_json(dict_obj):
  if type(dict_obj) is dict:
    return HttpResponse(json.dumps(dict_obj))
  else:
    raise ValueError


def contains_keys(cdict, *keys):
  for key in keys:
    if not cdict.has_key(key):
      return False
  return True
